package com.zis.starter.core;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 *
 * 系统关键指标配置信息
 * Create by wangshen 2018/1/22
 */
@Configuration
@Component
@ConfigurationProperties(prefix = "custom")
@PropertySource("classpath:/application.properties")
public class CustomProperties {

    private String cacheTables;

    private Integer workerId;

    private Integer dataCenterId;

    public String getCacheTables() {
        return cacheTables;
    }

    public void setCacheTables(String cacheTables) {
        this.cacheTables = cacheTables;
    }

    public Integer getWorkerId() {
        return workerId;
    }

    public void setWorkerId(Integer workerId) {
        if (workerId == null) {
            workerId = 1;
        }
        this.workerId = workerId;
    }

    public Integer getDataCenterId() {
        return dataCenterId;
    }

    public void setDataCenterId(Integer dataCenterId) {
        if (dataCenterId == null) {
            dataCenterId = 1;
        }
        this.dataCenterId = dataCenterId;
    }
}
